package models;

import javax.persistence.Entity;

import play.db.jpa.Model;
@Entity
public class UserPlaceType extends Model {
   private int placeType;
   private String placeTypeDesc;
   
   public UserPlaceType(int placeType , String placeTypeDesc){
	   this.placeType = placeType;
	   this.placeTypeDesc = placeTypeDesc;
   }
  public static UserPlaceType findOrCreatePlaceType(int placeType,String desc){
	  UserPlaceType  newPlaceType = UserPlaceType.find("placeType = ?", placeType ).first();
	  if(newPlaceType == null){
		  return new UserPlaceType(placeType, desc);
	  }
	  return newPlaceType;
  }   
  public int getPlaceType() {
	   return placeType;
   }
   public void setPlaceType(int placeType) {
	 this.placeType = placeType;
   }
  public String getPlaceTypeDesc() {
	 return placeTypeDesc;
  }
  public void setPlaceTypeDesc(String placeTypeDesc) {
	 this.placeTypeDesc = placeTypeDesc;
   }
}
